const mongoose = require('mongoose')

// 用户表
const user =  mongoose.Schema({
  account: {
    type: String,
    unique: true,
  },
  password: {
    type: String,
    require: true
  },
  // 0: 管理员, 1: 教师, 2: 主任
  identify: {
    type: Number,
    emnu: [0, 1, 2],
    require: true
  },
  name: {
    type: String,
    require: true
  },
  // 0:男, 1: 女
  sex: {
    type: Number,
    emnu: [0, 1]
  },
  // 0:正常, 1:冻结
  status: {
    type: Number,
    emnu: [0, 1]
  },
  create_time: Date,
  update_time: Date,
})

module.exports = mongoose.model('user', user)